package com.lagou.client;

import com.lagou.service.UserService;
import com.lagou.service.com.lagou.util.RpcRequest;

import java.util.UUID;

public class ClientBootStrap {

//    public static  final String providerName="UserService#sayHello#";

    public static  RpcRequest request;

    static {
        RpcRequest request1 = new RpcRequest();
        request1.setMethodName("sayHello");
        request1.setClassName("userService");
        request1.setRequestId(UUID.randomUUID().toString());
        request = request1;
    }

    public static void main(String[] args) throws InterruptedException {

        RpcConsumer rpcConsumer = new RpcConsumer();
        UserService proxy = (UserService) rpcConsumer.createProxy(UserService.class, request);

        while (true){
            Thread.sleep(2000);

//            System.out.println("ssssss");
            System.out.println(proxy.sayHello("are you ok?"));
        }


    }




}
